package halilTest;

import java.io.IOException;
import java.net.DatagramPacket;

import kidsProjectServer.BootstrapServer;

public class BootstrapReciever implements Runnable{

	private BootstrapH bs;
	byte[] buf = new byte[521];
	DatagramPacket p = new DatagramPacket(buf, 512);
	
	public BootstrapReciever(BootstrapH bs){
		this.bs = bs;
	}

	@Override
	public void run() {
		while(true){
			try {
				bs.getSocket().receive(p);
				bs.addMessage(new String(p.getData()));
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} 
		}
		
	}

}
